package com.cqyanyu.yanyu.model;

import android.text.TextUtils;

import com.cqyanyu.yanyu.utils.XDateUtil;
import com.fasterxml.jackson.annotation.JsonProperty;


import java.io.Serializable;

/**
 * 会员模型
 * Created by cheng on 2016/3/13.
 */
public class UserInfoEntity implements Serializable {

    public final static int EVENT_UPDATE = 0; //更新用户信息
    public final static int EVENT_LOGIN = 1;//登录
    public final static int EVENT_LOGOUT = 2;//退出
    public final static int EVENT_REG_MOBILE = 3; //手机号注册
    public final static int EVENT_REG_EMAIL = 3; //email注册
    @JsonProperty("key_id")
    public int uid;
    public String password = "";
    public String username = "";
    public String nickname = ""; //昵称
    public String status; //状态
    public String mobile = "";//手机号码
    public String avatar = "";   //头像
    public long update_time = 0; //更新时间
    public long reg_time = 0;  //注册时间
    public String token = "";
    public String code;//手机验证码
    public String groupid;
    public String parentmobile;
    public int auth;
    public String portrait;//肖像
    public String name;//用户名
    public String area_list_name;//地区
    public String update;
    public long lastUpdateTime;
    public int event_type = EVENT_UPDATE;//0 更新UserInfo,1 登录,2退出

    //账号信息
    public String area_id;
    public String weibo_nickname;
    public String qq_open_id;
    public String wechat_nickname;
    public String sex;
    public String sex_name;
    public String email;
    public String header_img;
    public String wechat_open_id;
    public String weibo_open_id;
    public String qq_nickname;
    public String qq_img_url;
    public String wechat_img_url;
    public String weibo_img_url;

    //获取个人信息
    private String encrypt;
    private String login;
    private String money;
    private String credits;
    private String reg_ip;
    private String last_login_ip;
    private String last_login_time;
    private String model_id;
    private String tuijianrenid;
    private String paypasswrod;
    private String heard_img;
    private String third_type;
    private String open_id;
    private String area_name_list;
    private String area_id_list;
    private String signature;//个性签名
    private long dateofbirth = -288000;
    private String fans_num;
    private String third_type_name;

    public String getDateofbirthYMD() {
        return XDateUtil.getStringByFormat(getDateofbirth1000(), XDateUtil.dateFormatYMD);
    }

    public String getArea_id() {
        return area_id;
    }

    public void setArea_id(String area_id) {
        this.area_id = area_id;
    }

    public String getWeibo_nickname() {
        return weibo_nickname;
    }

    public void setWeibo_nickname(String weibo_nickname) {
        this.weibo_nickname = weibo_nickname;
    }

    public String getQq_open_id() {
        return qq_open_id;
    }

    public void setQq_open_id(String qq_open_id) {
        this.qq_open_id = qq_open_id;
    }

    public String getWechat_nickname() {
        return wechat_nickname;
    }

    public void setWechat_nickname(String wechat_nickname) {
        this.wechat_nickname = wechat_nickname;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSex_name() {
        return sex_name;
    }

    public void setSex_name(String sex_name) {
        this.sex_name = sex_name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getHeader_img() {
        return header_img;
    }

    public void setHeader_img(String header_img) {
        this.header_img = header_img;
    }

    public String getName() {
        return name;
    }

    public String getNameText() {
        if (!TextUtils.isEmpty(name)) {
            return name;
        } else {
            return "未填写";
        }
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWechat_open_id() {
        return wechat_open_id;
    }

    public void setWechat_open_id(String wechat_open_id) {
        this.wechat_open_id = wechat_open_id;
    }

    public String getWeibo_open_id() {
        return weibo_open_id;
    }

    public void setWeibo_open_id(String weibo_open_id) {
        this.weibo_open_id = weibo_open_id;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getQq_nickname() {
        return qq_nickname;
    }

    public void setQq_nickname(String qq_nickname) {
        this.qq_nickname = qq_nickname;
    }

    public String getSexText() {
        if (!TextUtils.isEmpty(sex_name)) {
            return sex_name;
        }
        return "未填写";
    }

    public String getSex() {
        return sex;
    }

    public int getSexInt() {
        try {
            return Integer.parseInt(sex);
        } catch (Exception e) {
        }
        return 0;
    }

    public String getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(String encrypt) {
        this.encrypt = encrypt;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public String getCredits() {
        return credits;
    }

    public void setCredits(String credits) {
        this.credits = credits;
    }

    public String getReg_ip() {
        return reg_ip;
    }

    public void setReg_ip(String reg_ip) {
        this.reg_ip = reg_ip;
    }

    public String getLast_login_ip() {
        return last_login_ip;
    }

    public void setLast_login_ip(String last_login_ip) {
        this.last_login_ip = last_login_ip;
    }

    public String getLast_login_time() {
        return last_login_time;
    }

    public void setLast_login_time(String last_login_time) {
        this.last_login_time = last_login_time;
    }

    public String getModel_id() {
        return model_id;
    }

    public void setModel_id(String model_id) {
        this.model_id = model_id;
    }

    public String getTuijianrenid() {
        return tuijianrenid;
    }

    public void setTuijianrenid(String tuijianrenid) {
        this.tuijianrenid = tuijianrenid;
    }

    public String getPaypasswrod() {
        return paypasswrod;
    }

    public void setPaypasswrod(String paypasswrod) {
        this.paypasswrod = paypasswrod;
    }

    public String getHeard_img() {
        return heard_img;
    }

    public void setHeard_img(String heard_img) {
        this.heard_img = heard_img;
    }

    public String getThird_type() {
        return third_type;
    }

    public void setThird_type(String third_type) {
        this.third_type = third_type;
    }

    public String getOpen_id() {
        return open_id;
    }

    public void setOpen_id(String open_id) {
        this.open_id = open_id;
    }

    public String getArea_name_list() {
        if (!TextUtils.isEmpty(area_name_list)) {
            return area_name_list;
        } else {
            return "未填写";
        }
    }

    public void setArea_name_list(String area_name_list) {
        this.area_name_list = area_name_list;
    }

    public String getArea_id_list() {
        return area_id_list;
    }

    public void setArea_id_list(String area_id_list) {
        this.area_id_list = area_id_list;
    }

    public String getSignature() {
        return signature;
    }

    public String getSignatureText() {
        if (!TextUtils.isEmpty(signature)) {
            return signature;
        } else {
            return "未填写";
        }
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public long getDateofbirth() {
        return dateofbirth;
    }

    public long getDateofbirth1000() {
        return dateofbirth * 1000;
    }

    public void setDateofbirth(long dateofbirth) {
        this.dateofbirth = dateofbirth;
    }

    public String getFans_num() {
        return fans_num;
    }

    public void setFans_num(String fans_num) {
        this.fans_num = fans_num;
    }

    public String getThird_type_name() {
        return third_type_name;
    }

    public void setThird_type_name(String third_type_name) {
        this.third_type_name = third_type_name;
    }


}
